package com.example.qu_tao.View;


import android.annotation.SuppressLint;
import android.content.Intent;
import android.text.Layout;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.example.qu_tao.R;

public class FabuFragment extends BaseFragment implements View.OnClickListener {

    private TextView close;
    private LinearLayout fahuopin;
    private LinearLayout facaigou;
    @Override
    protected int getLayoutId() {
        return R.layout.fargment_fabu;
    }


    @Override
    protected void initView() {
        close = mView.findViewById(R.id.close_fabu);
        fahuopin = mView.findViewById(R.id.add_goods);
        facaigou = mView.findViewById(R.id.facaigou);
        close.setOnClickListener(this);
        fahuopin.setOnClickListener(this);
        facaigou.setOnClickListener(this);
    }

    @Override
    protected void initListener() {

    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
        if (id == R.id.close_fabu) {
                fragmentManager.popBackStack();
        } else if (id == R.id.add_goods) {
            Intent intent = new Intent(mContext, fahuopinActivity.class);
            startActivity(intent);
        }else if (id == R.id.facaigou) {
            Intent intent = new Intent(mContext, FabuCaiGouActivity.class);
            startActivity(intent);
        }
    }
}
